Comments

Yes, XML has comments, and it is always a good idea to use them.  
Why comment?  If you are a programmer, you already know why.  
If not, understand that at some point, someone is going to have to 
look at some XML document you did and figure out why you did it 
that way (beware, it may just be you!).  Getting in a good habit of 
commenting what you do will save you lot’s of time and frustration 
in the long run.

The syntax for comments is:

<!-- This text is a comment -->

The start of a comment is represented by the <!-- characters, while 
the end of the comment is represented by the -->.  

Warning:	Do not use spaces in the start and end tags of a 
comment.  It will result in a misinterpretation of your document and 
may even result in unexpected behavior

You can put comments anywhere inside of your XML document, as 
long as it is outside other markup and not within an element.  The 
would result in an error:

<name <!-- employee name -->>

Comments can not be placed with elements.  The following is not 
a comment, but in fact part of an element value.  Do not be surprised 
to find that this line causes different behaviors in different XML 
processors.

<another>This is <!-- oops --> another
error</another>

Anything within a valid comment block will be ignored by an XML 
processor.  In the following example, the <name>, <first> and <last> 
tags are all ignored.

<!-- We have commented out the name elements.
<name>
	<first>John</first>
	<last>Doe</last>
</name>
-->

Do not use comments for anything other than documenting your code.  
It may seem advantages to stick something in a comment that a 
specific application could use later, but that is not what comments 
are for.  In fact, it might not give you the results you expect.  

Warning:	The XML specification does not require that comments 
be passed to an application.  Some XML processors may strip the 
comments out before the application sees them.

It is important to comment your XML documents.  Even though 
XML is designed to be readable, everything is relative.  Even XML 
can look pretty complicated when you take advantage of all of its 
capabilities.

File: Chapter 2\Employees4.xml in XML Notepad

File: Chapter 2\Employees4.xml in IE5